package pers.mingshan.thread.thread.producerconsumer;

/**
 * 消费者
 * 
 * @author mingshan
 *
 */
public class Consumer implements Runnable {

    private EventStorage storage;

    public Consumer(EventStorage storage) {
        this.storage = storage;
    }
 
    @Override
    public void run() {
        System.out.println("消费者开始消费产品");
        while(true) {
            try {
              Thread.sleep(1000);
            } catch (Exception e) {
                e.printStackTrace();
            }
            this.storage.get();
        }
    }

}
